﻿<?php $this->load->view('layout/header'); ?>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
<form name="form1" method="post" action="<?php echo b_url('config/admingroup_setadmin_action/').$admingroupid;?>" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
<div>
</div>
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    分配管理员
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    管理组：
                </td>
                <td>
                    <span id="lblAdminGroupName">系统管理组</span>
                    &nbsp;
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    管理员：
                </td>
                <td>
                    <select name="adminid" id="drpAdminID">
        			<option value="-1">请选择</option>
                    <?php foreach ($userinfo as $key => $value):?>
        			<option value="<?php echo $value['adminid']?>"><?php echo $value['adminname']?></option>
                    <?php endforeach;?>
        		</select>
                    <span id="RequiredFieldValidator2" style="color:Red;display:none;">请选择</span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">&nbsp;
                    
                </td>
                <td colspan="3">
                    <input type="submit"  value="保存" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSave" />
                    <input type="button"  value="返回" onclick="javascript:reseturl();" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
        <div class="DivTitle">
            <strong>已分配管理员列表</strong></div>
        <!--列表开始-->
        <div>
	<table class="GridView" cellspacing="0" rules="all" border="0" id="GridView1" style="border-width:0px;width:100%;border-collapse:collapse;">
		<tr class="GridView_HeaderStyle">
			<th scope="col">管理员</th><th scope="col">操作</th>
		</tr>
        <?php if(!empty($groupinfo)){ ?>
        <?php foreach ($groupinfo as $k => $v):?>
        <tr class="GridView_RowStyle">
			<td><?php echo $v['adminname']?></td><td><a href="<?php echo b_url('config/delete_adminingroup/').$admingroupid.'/'.$v['adminid'];?>">删除</a></td>
		</tr>
        <?php endforeach ; ?>
        <?php }?>
	</table>
</div>
        <!--列表结束-->
    </div>
    
<script type="text/javascript">
//<![CDATA[
var Page_Validators =  new Array(document.getElementById("RequiredFieldValidator2"));
//]]>
</script>

<script type="text/javascript">
//<![CDATA[
var RequiredFieldValidator2 = document.all ? document.all["RequiredFieldValidator2"] : document.getElementById("RequiredFieldValidator2");
RequiredFieldValidator2.controltovalidate = "drpAdminID";
RequiredFieldValidator2.focusOnError = "t";
RequiredFieldValidator2.errormessage = "请选择";
RequiredFieldValidator2.display = "Dynamic";
RequiredFieldValidator2.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator2.initialvalue = "-1";
//]]>
</script>

<script type="text/javascript">
//<![CDATA[

var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}

function reseturl() {
    window.location.href=b_url+"/config/admingroup";
}
        //]]>
</script>
</body>
</html>

